# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/11/12 0012 11:47
@Author : 测试开发工程师
@File : cal_time.py
@Software: PyCharm
============================
"""

import time


# 计时装饰器
def cal_time(func):
    def wrapper(*args, **kwargs):
        t1 = time.time()
        result = func(*args, **kwargs)
        t2 = time.time()
        # print(f"{func.__name__} running time:{t2 - t1} secs")
        print("%s running time: %s secs." % (func.__name__, t2 - t1))
        return result

    return wrapper
